<div ng-controller="receivableAddController" dw-loading="receivable">
    <div class="bg-light lter b-b wrapper-sm">
        <h1 class="m-n font-thin h4">新增应收订单</h1>
    </div>
    <div class="wrapper-sm">
        <div class="panel panel-default">
            <div class="panel-body">
                <form name="reconform" id="reconform" class="form-validation form-horizontal" novalidate>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-t-n m-b-sm">
                            基本信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">计划专员  :</label>
                        <div class="col-lg-2">
                            <select class="form-control input-sm" id="planOfficer" ng-model="planOfficerId" name="planOfficer" required ng-options="x.id as x.realName for x in independentList" disabled="disabled">
                            </select>
                        </div>
                        <label class="pull-left control-label">商务专员  :</label>
                        <div class="col-lg-2">
                            <select class="form-control input-sm" id="businessOfficerId" ng-model="businessOfficerId" name="businessOfficer" required ng-options="x.id as x.realName for x in independentList" disabled="disabled">
                            </select>
                        </div>
                        <label class="pull-left control-label">客服专员  :</label>
                        <div class="col-lg-2">
                            <select class="form-control input-sm" id="customerServiceOfficerId" ng-model="customerServiceOfficerId" name="customerServiceOfficer" required ng-options="x.id as x.realName for x in independentList" disabled="disabled">
                            </select>
                        </div>
                        <label class="pull-left control-label">调度专员  :</label>
                        <div class="col-lg-2">
                            <select class="form-control input-sm" id="dispatchOfficerId" ng-model="dispatchOfficerId" name="dispatchOfficer" required ng-options="x.id as x.realName for x in independentList" disabled="disabled">
                                
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">客户单位<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <div angucomplete-alt
                                 id="client"
                                 placeholder=""
                                 pause="100"
                                 selected-object="clientSelect"
                                 remote-api-handler="searchClient"
                                 local-data="clientData"
                                 search-fields="name"
                                 title-field="name"
                                 minlength="1"
                                 input-class="form-control form-control-small input-sm"
                                 initial-value="clientName"
                                 field-required="true"
                                 match-class="highlight"
                                 input-name="client" >
                            </div>
                        </div>
                        <label class="pull-left control-label">发货计划人<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_consignorName" type="text" class="form-control input-sm" ng-model="consignorName" placeholder="请填写发货计划人" disabled="disabled" name="consignorName" required>
                        </div>
                        <label class="pull-left control-label">发货人电话<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_consignorPhone" type="text" class="form-control input-sm" ng-model="consignorPhone" placeholder="请填写发货计划人" disabled="disabled" name="consignorPhone" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">发货地址<span class="text-danger">*</span></label>
                        <div class="col-lg-10">
                            <tms-address ng-required="true" 
                            class="pull-left" 
                            city-list="shipCityList"
                             area-list="shipAreaList" 
                             province="shipProvinceCode" 
                             city="shipCityCode" 
                             area="shipAreaCode"></tms-address>
                             <div class="col-lg-4 m-l-n-sm">
                                 <input id="receivableAdd_shipAddress" type="text" ng-required="true" required class="form-control input-sm" ng-model="shipAddress" placeholder="请填写详细地址" name="shipAddress">
                             </div>

                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">送货地址<span class="text-danger">*</span></label>
                        <div class="col-lg-10">
                            <tms-address ng-required="true"  
                            class="pull-left" 
                            city-list="deliverCityList" 
                            area-list="deliverAreaList" 
                            province="deliverProvinceCode" 
                            city="deliverCityCode" 
                            area="deliverAreaCode"></tms-address>
                            <div class="col-lg-4 m-l-n-sm">
                                <input id="receivableAdd_deliverAddress" type="text" ng-required="true" required class="form-control input-sm" ng-model="deliverAddress" placeholder="请填写详细地址" name="deliverDetail">
                            </div>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label">发货时间<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <div class="input-group input-group-sm date">
                                <input id="deliveryTime" name="deliveryTime" datetimepicker plugintype="datetime" required name="shipTime" ng-model="shipTime" placeholder="发货时间" class="form-control" type="text" />
                                <span id="opendeliveryTime" class="input-group-addon curpoint">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                        </div>
                        <label class="pull-left control-label">到货时间<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <div class="input-group input-group-sm date">
                                <input id="arrivalTime" name="arrivalTime" datetimepicker plugintype="datetime" required name="arriveTime" ng-model="arriveTime" placeholder="到货时间" class="form-control" type="text" />
                                <span id="openarrivalTime" class="input-group-addon curpoint">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            货物信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">货物类别<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <select name="goodsType" id="goodsType" class="form-control input-sm" ng-required="true" ng-model="goodsTypeId" ng-change="changeGoodsType()" ng-options="x.id as x.name for x in goodsTypeDropDown">
                                <option value="">请选择</option>
                            </select>
                        </div>
                        
                        <label class="pull-left control-label">货物名称<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <select class="form-control input-sm" id="goodsId" required  ng-required="true" ng-model="goodsId" name="goodsId" ng-change="changeGoodName()" ng-options="x.id as x.name for x in goodsDropDown">
                                <option value="">请选择</option>
                            </select>
                        </div>
                        <label class="col-lg-1 pull-left control-label">货物数量<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_goodsNum" type="text" ng-pattern="/^[0-9]+(.[0-9]{1,4})?$/" class="form-control input-sm" ng-model="goodsNum" placeholder="请填写货物数量" name="goodsNum" required>

                        </div>
                        <div class="pull-left m-l-n-sm">
                            <select class="form-control input-sm" id="goodsNumUnit" ng-model="goodsNumUnit" name="goodsNumUnit" required ng-options="x.value as x.text for x in goodsNumUnitDropDown">
                                <option value="">请选择</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="panel-heading font-bold m-b-sm">
                            应收价格信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">应收单价<span class="text-danger">*</span></label>
                        <div class="col-lg-2">

                            <input id="receivableAdd_receivablePrice" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" class="form-control input-sm" ng-model="receivablePrice" placeholder="请填写应收单价" required name="receivablePrice">

                        </div>
                        <div class="pull-left m-l-n-sm">
                            <select class="form-control input-sm" id="receivablePriceUnit" ng-model="receivablePriceUnit" name="receivablePriceUnit" ng-options="x.value as x.text for x in priceUnitDropDown" required>
                                <option value="">请选择</option>
                            </select>
                        </div>
                        <label class="pull-left m-l control-label">应收总价</label>
                        <div class="col-lg-2">

                            <input id="receivableAdd_receivableTotal" type="text" ng-pattern="/^(-)?[0-9]+(.[0-9]{1,2})?$/" class="form-control input-sm" ng-model="receivableTotal" placeholder="请填写应收总价" name="receivableTotal">

                        </div>
                        <label class="pull-left m-l-n-sm control-label">元</label>
                        <label class="col-lg-1 pull-left control-label">应收说明</label>
                        <div class="col-lg-4">
                            <input id="receivableAdd_receivableRemarks" type="text" class="form-control input-sm" ng-model="receivableRemarks" placeholder="请填写应收说明" name="receivableRemarks">

                        </div>
                    </div>
                    <div class="form-group" ng-show="true">
                        <div class="panel-heading font-bold m-b-sm">
                            承运商信息
                        </div>
                        <label class="col-lg-1 pull-left control-label">承运商名称<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <div angucomplete-alt
                                 id="carrierName"
                                 placeholder=""
                                 pause="100"
                                 remote-api-handler="searchCarrier"
                                 selected-object="carrierSelect"
                                 search-fields="name"
                                 title-field="name"
                                 minlength="1"
                                 input-class="form-control form-control-small input-sm"
                                 initial-value="carrierName"
                                  field-required="true"
                                 match-class="highlight"
                                 input-name="carrier">
                            </div>
                        </div>
                        <label class="pull-left control-label">结算方号码<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_carrierPhone" type="tel" class="form-control input-sm" ng-model="carrierPhone" placeholder="请填写承运商号码" disabled="disabled" ng-pattern="/^1\d{10}$/" required name="carrierPhone">

                            <span class="text-danger">请仔细核对电话，可能存在重名承运商。</span>
                        </div>
                        <label class="pull-left control-label">承运商类型<span class="text-danger">*</span></label>
                        <div class="col-lg-2">

                            <input id="receivableAdd_carrierType" class="form-control input-sm" ng-model="carrierType" name="carrierType" disabled="disabled" required>

                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">车牌号<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <div angucomplete-alt
                                 id="carCode"
                                 disable-input="dispatchOfficerDis"
                                 placeholder=""
                                 pause="100"
                                 selected-object="carCodeSelect"
                                 remote-api-handler="searchCar"
                                 search-fields="carCode"
                                 title-field="carCode"
                                 minlength="1"
                                 input-class="form-control form-control-small input-sm"
                                 initial-value="carCode"
                                 field-required="true"
                                 match-class="highlight"
                                 input-name="car">
                            </div>
                        </div>
                        <label class="pull-left control-label">驾驶员号码<span class="text-danger">*</span></label>
                        <div class="col-lg-2">

                            <input id="receivableAdd_driverPhone" type="text" disabled="disabled" class="form-control input-sm" ng-model="driverPhone" placeholder="请填写驾驶员号码" name="driverPhone" required>
                        </div>
                        <label class="pull-left control-label">驾驶员姓名<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_driverName" type="text" disabled="disabled" class="form-control input-sm" ng-model="driverName" placeholder="请填写驾驶员姓名" name="driverName" required>

                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">车长<span class="text-danger">*</span></label>
                        <div class="col-lg-2">

                            <input id="receivableAdd_carLength" class="form-control input-sm" ng-model="carLength" name="carLength" required disabled="disabled">
                        </div>
                        <label class="w-xxss pull-left control-label">车型<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_carType" required class="form-control input-sm" ng-model="carType" name="carType" disabled="disabled">

                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">银行卡号<span class="text-danger">*</span></label>
                        <div class="col-lg-3">

                            <input id="receivableAdd_bankCode" type="text" class="form-control input-sm" ng-model="bankCode" placeholder="请填写银行卡号" disabled="disabled" name="bankCode" required>
                        </div>
                        <label class="col-lg-1 pull-left control-label">开户银行<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_bankName" type="text" class="form-control input-sm" ng-model="bankName" placeholder="请填写开户银行" disabled="disabled" name="bankName" required>
                        </div>
                        <label class="col-lg-1 pull-left control-label">持卡人姓名<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_holder" type="text" class="form-control input-sm" ng-model="holder" placeholder="请填写持卡人姓名" disabled="disabled" name="holder" required>

                        </div>
                        <div class="line pull-in"></div>
                        <label class="col-lg-1 pull-left control-label">应付单价<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                           

                            <input id="receivableAdd_payablePrice" type="text" class="form-control input-sm" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" ng-model="payablePrice" name="payablePrice" required>

                        </div>
                        <div class="pull-left m-l-n-sm">
                            <select class="form-control input-sm" id="payablePriceUnit" name="payablePriceUnit" ng-model="payablePriceUnit" required ng-options="x.value as x.text for x in priceUnitDropDown">
                                <option value="">请选择</option>
                            </select>
                        </div>
                        <label class="col-lg-1 pull-left control-label">驾驶证号<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_driverLicenseNumber" type="text" ng-pattern="/^[A-Za-z0-9]+$/" minlength="18" maxlength="18" class="form-control input-sm" ng-model="driverLicenseNumber" name="driverLicenseNumber" required>
                        </div>
                        <label class="col-lg-1 pull-left control-label">合同号<span class="text-danger">*</span></label>
                        <div class="col-lg-2">
                            <input id="receivableAdd_contractNumber" type="text" class="form-control input-sm" required ng-model="contractNumber" name="contractNumber">

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-1 pull-left control-label"></label>
                        <div class="col-lg-7">

                            <button id="receivableAdd_check" class="pull-right-xs btn btn-sm btn-success btn-addon" ng-click="addReceivable()" ng-disabled="!reconform.$valid"><i class="fa fa-check"></i>确定</button>
                            <button id="receivableAdd_back" class="pull-right-xs btn btn-sm btn-warning btn-addon" ng-click="back()"><i class="fa fa-mail-reply"></i>取消</button>

                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>